| 1 |  |  | /*jslint | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |   indent: 4 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | /*global | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |   $, google, Lang, Lines, Markers, Conversion, Cookies, Coordinates, trackMarker, showAlert, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |   id2alpha, alpha2id, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |   showProjectionDialog, showLinkDialog, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |   osmProvider, osmDeProvider, thunderforestProvider, opentopomapProvider, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |   get_cookie_int, get_cookie_float, get_cookie_string, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |   Attribution, Sidebar, ExternalLinks, Hillshading, Geolocation, NPA, CDDA, Freifunk, Okapi, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |   DownloadGPX, API_KEY_THUNDERFOREST, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |   restoreCoordinatesFormat, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |   document | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | //var boundariesLayer = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | //var boundariesLayerShown = false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | var CLAT_DEFAULT = 51.163375; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | var CLON_DEFAULT = 10.447683; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | var ZOOM_DEFAULT = 12; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | var MAPTYPE_DEFAULT = "OSM"; | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 24 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 25 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 26 |  |  | var Map = {}; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 27 |  |  | Map.m_map = null; | 
            
                                                                        
                            
            
                                    
            
            
                | 28 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 29 |  |  | Map.init = function (xcenter, xzoom, xmap, xfeatures, xmarkers, xlines, xgeocache) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 30 |  |  |     'use strict'; | 
            
                                                                        
                            
            
                                    
            
            
                | 31 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 32 |  |  |     var center, | 
            
                                                                        
                            
            
                                    
            
            
                | 33 |  |  |         atDefaultCenter = false, | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  |         zoom = parseInt(xzoom, 10), | 
            
                                                                        
                            
            
                                    
            
            
                | 35 |  |  |         maptype = xmap, | 
            
                                                                        
                            
            
                                    
            
            
                | 36 |  |  |         loadfromcookies = false, | 
            
                                                                        
                            
            
                                    
            
            
                | 37 |  |  |         markerdata = this.parseMarkersFromUrl(xmarkers), | 
            
                                                                        
                            
            
                                    
            
            
                | 38 |  |  |         markercenter = null, | 
            
                                                                        
                            
            
                                    
            
            
                | 39 |  |  |         clat = 0, | 
            
                                                                        
                            
            
                                    
            
            
                | 40 |  |  |         clon = 0; | 
            
                                                                        
                            
            
                                    
            
            
                | 41 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 42 |  |  |     Lang.init(); | 
            
                                                                        
                            
            
                                    
            
            
                | 43 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 44 |  |  |     if (markerdata.length > 0) { | 
            
                                                                        
                            
            
                                    
            
            
                | 45 |  |  |         markerdata.map(function (m) { | 
            
                                                                        
                            
            
                                    
            
            
                | 46 |  |  |             clat += m.coords.lat(); | 
            
                                                                        
                            
            
                                    
            
            
                | 47 |  |  |             clon += m.coords.lng(); | 
            
                                                                        
                            
            
                                    
            
            
                | 48 |  |  |         }); | 
            
                                                                        
                            
            
                                    
            
            
                | 49 |  |  |         markercenter = new google.maps.LatLng(clat / markerdata.length, clon / markerdata.length); | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 51 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 52 |  |  |     if (xcenter && xcenter !== '') { | 
            
                                                                        
                            
            
                                    
            
            
                | 53 |  |  |         center = this.parseCenterFromUrl(xcenter); | 
            
                                                                        
                            
            
                                    
            
            
                | 54 |  |  |     } else if (markercenter) { | 
            
                                                                        
                            
            
                                    
            
            
                | 55 |  |  |         center = markercenter; | 
            
                                                                        
                            
            
                                    
            
            
                | 56 |  |  |     } else { | 
            
                                                                        
                            
            
                                    
            
            
                | 57 |  |  |         loadfromcookies = true; | 
            
                                                                        
                            
            
                                    
            
            
                | 58 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 59 |  |  |         /* try to read coordinats from cookie */ | 
            
                                                                        
                            
            
                                    
            
            
                | 60 |  |  |         clat = get_cookie_float('clat', CLAT_DEFAULT); | 
            
                                                                        
                            
            
                                    
            
            
                | 61 |  |  |         clon = get_cookie_float('clon', CLON_DEFAULT); | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |         if (clat === CLAT_DEFAULT && clon === CLON_DEFAULT) { | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |             atDefaultCenter = true; | 
            
                                                                        
                            
            
                                    
            
            
                | 64 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 65 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 66 |  |  |         clat = this.repairLat(clat, CLAT_DEFAULT); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |         clon = this.repairLon(clon, CLON_DEFAULT); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |         center = new google.maps.LatLng(clat, clon); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |         zoom = get_cookie_int('zoom', ZOOM_DEFAULT); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |         maptype = get_cookie_string('maptype', MAPTYPE_DEFAULT); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |     if (!center) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |         center = new google.maps.LatLng(CLAT_DEFAULT, CLON_DEFAULT); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |         atDefaultCenter = true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |     zoom = this.repairZoom(zoom, ZOOM_DEFAULT); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |     maptype = this.repairMaptype(maptype, MAPTYPE_DEFAULT); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |     Map.m_map = this.createMap("themap", center, zoom, maptype); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |     if (loadfromcookies) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |         this.parseMarkersFromCookies().map(function (m) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |             Markers.newMarker(m.coords, m.id, m.r, m.name, m.color); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |         this.parseLinesFromCookies().map(function (m) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |             Lines.newLine(m.source, m.target); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |     } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |         markerdata.map(function (m) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |             Markers.newMarker(m.coords, m.id, m.r, m.name, m.color); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |         this.parseLinesFromUrl(xlines).map(function (m) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |             Lines.newLine(m.source, m.target); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |     Okapi.setShowCache(xgeocache); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |     Sidebar.restore(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |     xfeatures = xfeatures.toLowerCase(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |     if (xfeatures === '[default]') { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |         Hillshading.restore(false); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |         //restoreBoundaries(false); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |         Okapi.restore(false); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |         NPA.toggle(false); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |         CDDA.toggle(false); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |         Freifunk.toggle(false); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |     } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |         Hillshading.toggle(xfeatures.indexOf('h') >= 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |         //toggleBoundaries(xfeatures.indexOf('b') >= 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |         Okapi.toggle(xfeatures.indexOf('g') >= 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |         NPA.toggle(xfeatures.indexOf('n') >= 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |         Freifunk.toggle(xfeatures.indexOf('f') >= 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |     restoreCoordinatesFormat("DM"); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  |     if (xgeocache !== "") { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  |         Okapi.toggle(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |         atDefaultCenter = false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |     Attribution.forceUpdate(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  |     if (atDefaultCenter) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |         Geolocation.whereAmI(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  | Map.storeCenter = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |     var c = Map.m_map.getCenter(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  |     Cookies.set('clat', c.lat(), {expires: 30}); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |     Cookies.set('clon', c.lng(), {expires: 30}); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  | Map.storeZoom = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |     Cookies.set('zoom', Map.m_map.getZoom(), {expires: 30}); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  | Map.storeMapType = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |     Cookies.set('maptype', Map.m_map.getMapTypeId(), {expires: 30}); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  | Map.getFeaturesString = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |     var s = ""; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |     //if ($('#boundaries').is(':checked')) { s += "b"; } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |     if ($('#geocaches').is(':checked')) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |         s += "g"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |     if ($('#hillshading').is(':checked')) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |         s += "h"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |     if ($('#npa').is(':checked')) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |         s += "n"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |     if ($('#freifunk').is(':checked')) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |         s += "f"; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |     return s; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  | Map.getPermalink = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |     var lat = Map.m_map.getCenter().lat(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |         lng = Map.m_map.getCenter().lng(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |         geocache = Okapi.popupCacheCode(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |         url = "https://flopp.net/" + | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |                 "?c=" + lat.toFixed(6) + ":" + lng.toFixed(6) + | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |                 "&z=" + Map.m_map.getZoom() + | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |                 "&t=" + Map.m_map.getMapTypeId() + | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |                 "&f=" + this.getFeaturesString() + | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |                 "&m=" + Markers.toString() + | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |                 "&d=" + Lines.getLinesText(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |     if (geocache) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |         url += "&g=" + geocache; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |     return url; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  | Map.generatePermalink = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |     var link = this.getPermalink(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |     showLinkDialog(link); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  | Map.repairLat = function (x, d) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |     if (Coordinates.validLat(x)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |         return x; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 |  |  |     return d; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 |  |  | Map.repairLon = function (x, d) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  |     if (Coordinates.validLng(x)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 219 |  |  |         return x; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 220 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 221 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 222 |  |  |     return d; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 223 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 224 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 225 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 226 |  |  | Map.repairRadius = function (x, d) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 227 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 228 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 229 |  |  |     if (x === null || isNaN(x) || x < 0 || x > 100000000) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 230 |  |  |         return d; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 231 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 232 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 233 |  |  |     return x; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 234 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 235 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 236 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 237 |  |  | Map.repairZoom = function (x, d) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 238 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 239 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 240 |  |  |     if (x === null || isNaN(x) || x < 1 || x > 20) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 241 |  |  |         return d; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 242 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 243 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 244 |  |  |     return x; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 245 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 246 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 247 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 248 |  |  | Map.repairMaptype = function (t, d) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 249 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 250 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 251 |  |  |     var mapTypes = { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 252 |  |  |         "OSM": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 253 |  |  |         "OSM/DE": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 254 |  |  |         "OCM": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 255 |  |  |         "OUTD": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 256 |  |  |         "TOPO": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 257 |  |  |         "satellite": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 258 |  |  |         "hybrid": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 259 |  |  |         "roadmap": 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 260 |  |  |         "terrain": 1 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 261 |  |  |     }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 262 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 263 |  |  |     if (mapTypes[t]) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 264 |  |  |         return t; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 265 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 266 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 267 |  |  |     return d; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 268 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 269 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 270 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 271 |  |  | Map.parseMarkersFromUrl = function (urlarg) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 272 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 273 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 274 |  |  |     if (urlarg === null) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 275 |  |  |         return []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 276 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 277 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 278 |  |  |     var markers = [], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 279 |  |  |         data; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 280 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 281 |  |  |     // ID:COODRS:R(:NAME)?|ID:COORDS:R(:NAME)? | 
            
                                                                                                            
                            
            
                                    
            
            
                | 282 |  |  |     // COORDS=LAT:LON or DEG or DMMM | 
            
                                                                                                            
                            
            
                                    
            
            
                | 283 |  |  |     if (urlarg.indexOf("*") >= 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 284 |  |  |         data = urlarg.split('*'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 285 |  |  |     } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 286 |  |  |         /* sep is '|' */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 287 |  |  |         data = urlarg.split('|'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 288 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 289 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 290 |  |  |     data.map(function (dataitem) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 291 |  |  |         dataitem = dataitem.split(':'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 292 |  |  |         if (dataitem.length < 3 || dataitem.length > 6) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 293 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 294 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 295 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 296 |  |  |         var m = { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 297 |  |  |                 alpha: dataitem[0], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 298 |  |  |                 id: alpha2id(dataitem[0]), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 299 |  |  |                 name: null, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 300 |  |  |                 coords: null, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 301 |  |  |                 r: 0, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 302 |  |  |                 color: "" | 
            
                                                                                                            
                            
            
                                    
            
            
                | 303 |  |  |             }, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 304 |  |  |             index = 1, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 305 |  |  |             lat, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 306 |  |  |             lon; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 307 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 308 |  |  |         if (m.id < 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 309 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 310 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 311 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 312 |  |  |         lat = parseFloat(dataitem[index]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 313 |  |  |         lon = parseFloat(dataitem[index + 1]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 314 |  |  |         if (Coordinates.valid(lat, lon)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 315 |  |  |             index += 2; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 316 |  |  |             m.coords = new google.maps.LatLng(lat, lon); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 317 |  |  |         } else { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 318 |  |  |             m.coords = Coordinates.fromString(dataitem[index]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 319 |  |  |             index += 1; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 320 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 321 |  |  |         if (!m.coords) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 322 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 323 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 324 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 325 |  |  |         m.r = this.repairRadius(parseFloat(dataitem[index]), 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 326 |  |  |         index = index + 1; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 327 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 328 |  |  |         if (index < dataitem.length && | 
            
                                                                                                            
                            
            
                                    
            
            
                | 329 |  |  |                 (/^([a-zA-Z0-9\-_]*)$/).test(dataitem[index])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 330 |  |  |             m.name = dataitem[index]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 331 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 332 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 333 |  |  |         index = index + 1; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 334 |  |  |         if (index < dataitem.length && | 
            
                                                                                                            
                            
            
                                    
            
            
                | 335 |  |  |                 (/^([a-fA-F0-9]{6})$/).test(dataitem[index])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 336 |  |  |             m.color = dataitem[index]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 337 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 338 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 339 |  |  |         markers.push(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 340 |  |  |     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 341 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 342 |  |  |     return markers; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 343 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 344 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 345 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 346 |  |  | Map.parseCenterFromUrl = function (urlarg) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 347 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 348 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 349 |  |  |     if (urlarg === null) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 350 |  |  |         return null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 351 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 352 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 353 |  |  |     var data = urlarg.split(':'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 354 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 355 |  |  |     if (data.length === 1) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 356 |  |  |         return Coordinates.fromString(data[0]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 357 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 358 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 359 |  |  |     if (data.length === 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 360 |  |  |         return Coordinates.toLatLng(parseFloat(data[0]), parseFloat(data[1])); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 361 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 362 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 363 |  |  |     return null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 364 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 365 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 366 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 367 |  |  | Map.parseLinesFromUrl = function (urlarg) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 368 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 369 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 370 |  |  |     if (urlarg === null) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 371 |  |  |         return []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 372 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 373 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 374 |  |  |     var lines = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 375 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 376 |  |  |     /* be backwards compatible */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 377 |  |  |     if (urlarg.length === 3 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 378 |  |  |             && alpha2id(urlarg[0]) >= 0 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 379 |  |  |             && urlarg[1] === '*' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 380 |  |  |             && alpha2id(urlarg[1]) >= 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 381 |  |  |         urlarg = urlarg[0] + ':' + urlarg[2]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 382 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 383 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 384 |  |  |     urlarg.split('*').map(function (pair_string) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 385 |  |  |         var pair = pair_string.split(':'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 386 |  |  |         if (pair.length === 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 387 |  |  |             lines.push({source: alpha2id(pair[0]), target: alpha2id(pair[1])}); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 388 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 389 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 390 |  |  |     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 391 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 392 |  |  |     return lines; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 393 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 394 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 395 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 396 |  |  | Map.parseMarkersFromCookies = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 397 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 398 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 399 |  |  |     var raw_ids = Cookies.get('markers'), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 400 |  |  |         markers = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 401 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 402 |  |  |     if (raw_ids === null || raw_ids === undefined) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 403 |  |  |         return markers; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 404 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 405 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 406 |  |  |     raw_ids.split(':').map(function (id_string) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 407 |  |  |         var m = {id: null, name: null, coords: null, r: 0, color: ""}, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 408 |  |  |             raw_data, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 409 |  |  |             data; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 410 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 411 |  |  |         m.id = parseInt(id_string, 10); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 412 |  |  |         if (m.id === null || m.id < 0 || m.id >= 26 * 10) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 413 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 414 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 415 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 416 |  |  |         raw_data = Cookies.get('marker' + m.id); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 417 |  |  |         if (!raw_data) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 418 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 419 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 420 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 421 |  |  |         data = raw_data.split(':'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 422 |  |  |         if (data.length !== 4 && data.length !== 5) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 423 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 424 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 425 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 426 |  |  |         m.coords = Coordinates.toLatLng(parseFloat(data[0]), parseFloat(data[1])); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 427 |  |  |         if (!m.coords) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 428 |  |  |             return; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 429 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 430 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 431 |  |  |         m.r = Map.repairRadius(parseFloat(data[2]), 0); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 432 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 433 |  |  |         if ((/^([a-zA-Z0-9\-_]*)$/).test(data[3])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 434 |  |  |             m.name = data[3]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 435 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 436 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 437 |  |  |         if (data.length === 5 && (/^([a-fA-F0-9]{6})$/).test(data[4])) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 438 |  |  |             m.color = data[4]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 439 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 440 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 441 |  |  |         markers.push(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 442 |  |  |     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 443 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 444 |  |  |     return markers; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 445 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 446 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 447 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 448 |  |  | Map.parseLinesFromCookies = function () { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 449 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 450 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 451 |  |  |     var raw_lines = Cookies.get('lines'), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 452 |  |  |         lines = []; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 453 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 454 |  |  |     if (!raw_lines) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 455 |  |  |         return lines; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 456 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 457 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 458 |  |  |     raw_lines.split('*').map(function (pair_string) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 459 |  |  |         var pair = pair_string.split(':'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 460 |  |  |         if (pair.length === 2) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 461 |  |  |             lines.push({source: alpha2id(pair[0]), target: alpha2id(pair[1])}); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 462 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 463 |  |  |     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 464 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 465 |  |  |     return lines; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 466 |  |  | }; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 467 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 468 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 469 |  |  | Map.createMap = function (id, center, zoom, maptype) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 470 |  |  |     'use strict'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 471 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 472 |  |  |     var m = new google.maps.Map( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 473 |  |  |         document.getElementById(id), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 474 |  |  |         { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 475 |  |  |             zoom: zoom, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 476 |  |  |             center: center, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 477 |  |  |             scaleControl: true, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 478 |  |  |             streetViewControl: false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 479 |  |  |             mapTypeControlOptions: {mapTypeIds: ['OSM', 'OSM/DE', 'OCM', 'OUTD', 'TOPO', google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.TERRAIN]}, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 480 |  |  |             mapTypeId: google.maps.MapTypeId.ROADMAP | 
            
                                                                                                            
                            
            
                                    
            
            
                | 481 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 482 |  |  |     ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 483 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 484 |  |  |     m.mapTypes.set("OSM", osmProvider("OSM")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 485 |  |  |     m.mapTypes.set("OSM/DE", osmDeProvider("OSM/DE")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 486 |  |  |     m.mapTypes.set("OCM", thunderforestProvider("OCM", "cycle", API_KEY_THUNDERFOREST)); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 487 |  |  |     m.mapTypes.set("OUTD", thunderforestProvider("OUTD", "outdoors", API_KEY_THUNDERFOREST)); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 488 |  |  |     m.mapTypes.set("TOPO", opentopomapProvider("TOPO")); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 489 |  |  |     m.setMapTypeId(maptype); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 490 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 491 |  |  |     Attribution.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 492 |  |  |     Sidebar.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 493 |  |  |     ExternalLinks.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 494 |  |  |     Markers.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 495 |  |  |     Lines.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 496 |  |  |     Geolocation.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 497 |  |  |     Hillshading.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 498 |  |  |     NPA.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 499 |  |  |     CDDA.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 500 |  |  |     Freifunk.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 501 |  |  |     Okapi.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 502 |  |  |     DownloadGPX.init(m); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 503 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 504 |  |  |     //boundariesLayer = new google.maps.ImageMapType({ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 505 |  |  |     //  getTileUrl: function(coord, zoom) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 506 |  |  |     //    if (6 <= zoom && zoom <= 16) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 507 |  |  |     //    { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 508 |  |  |     //      return tileUrl("http://korona.geog.uni-heidelberg.de/tiles/adminb/?x=%x&y=%y&z=%z", ["dummy"], coord, zoom); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 509 |  |  |     //    } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 510 |  |  |     //    else | 
            
                                                                                                            
                            
            
                                    
            
            
                | 511 |  |  |     //    { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 512 |  |  |     //      return null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 513 |  |  |     //    } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 514 |  |  |     //  }, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 515 |  |  |     //  tileSize: new google.maps.Size(256, 256), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 516 |  |  |     //  name: "adminb", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 517 |  |  |     //  alt: "Administrative Boundaries", | 
            
                                                                                                            
                            
            
                                    
            
            
                | 518 |  |  |     //  maxZoom: 16 }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 519 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 520 |  |  |     m.setCenter(center, zoom); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 521 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 522 |  |  |     google.maps.event.addListener(m, "center_changed", function () { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 523 |  |  |         Map.storeZoom(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 524 |  |  |         Map.storeCenter(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 525 |  |  |     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 526 |  |  |     google.maps.event.addListener(m, "zoom_changed", function () { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 527 |  |  |         Map.storeZoom(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 528 |  |  |         Map.storeCenter(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 529 |  |  |     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 530 |  |  |     google.maps.event.addListener(m, "maptypeid_changed", function () { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 531 |  |  |         Map.storeMapType(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 532 |  |  |     }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 533 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 534 |  |  |     return m; | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 535 |  |  | }; | 
            
                                                        
            
                                    
            
            
                | 536 |  |  |  |